package com.lxu.demo.mapStruct;

import com.lxu.demo.mapStruct.dto.TestDto;
import com.lxu.demo.mapStruct.entity.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class BootStrap {
    public static void main(String[] args) {
        Test test = new Test();
        test.setId("123");
        test.setName("999");

        /*ApplicationContext applicationContext =new AnnotationConfigApplicationContext(TestRepository.class);
        TestRepository testRepository = (TestRepository) applicationContext.getBean("testRepository");
        TestDto testDto = testRepository.toTarget(test);
        System.out.println(testDto);*/
        TestDto testDto = TestMapper.INSTANCE.toTarget(test);
        System.out.println(testDto);


    }
}
